export const thunk = ({dispatch, getState}) => next => action => {
    if(typeof action == 'function'){
        return action(dispatch, getState)
    }
    return next(action)
}
export const arrayThunk = ({dispatch, getState}) => next => action => {
    if(Array.isArray(action)){
        return action.forEach(v => dispatch(v))
    }
    return next(action)
}
